import axios from '../AxiosConfig.js'

export const whoami = () => {
    return axios({
        method: 'get',
        url: '/api/whoami'
    })
}

export const overview = () => {
    return axios({
        method: 'get',
        url: '/api/overview',
        params: {
            "lengths_age": 60,
            "lengths_incr": 5,
            "msg_rates_age": 60,
            "msg_rates_incr": 5
        }
    })
}

export const extensions = () => {
    return axios({
        method: 'get',
        url: '/api/extensions'
    })
}

export const selectClusterName = () => {
    return axios({
        method: 'get',
        url: '/api/cluster-name'
    })
}

export const updateClusterName = () => {
    return axios({
        method: 'put',
        url: '/api/cluster-name'
    })
}

export const exportDefinitions = () => {
    return axios({
        method: 'get',
        url: '/api/definitions'
    })
}

export const importDefinitions = () => {
    return axios({
        method: 'post',
        url: '/api/definitions'
    })
}

export const resetNode = (name) => {
    return axios({
        method: 'delete',
        url: '/api/reset/' + encodeURIComponent(name)
    })
}


